package cn.tedu.spring.config;

import cn.tedu.spring.bean.UserDao;
import cn.tedu.spring.eg2.Product;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestSpringConfig {
    public static void main(String[] args) {
        ApplicationContext context=new AnnotationConfigApplicationContext(SpringConfig.class);
        //获取eg2.Product
        Product product=context.getBean(Product.class);
        System.out.println(product);
        //获取bean.UserDao
        UserDao userDao= context.getBean(UserDao.class);
        System.out.println(userDao);

    }
}
